<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/restrito/layout/template.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ui:define name="content">

        <h:form>

            <p>
                <ui:insert name="content">

                </ui:insert>
            </p>

            <p align="center">

                <rich:dataTable value="#{lanceController.carregarLances()}" var="lance" id="table" rows="20" rowClasses="odd-row, even-row"
                                styleClass="stable">

                    <rich:column>  
                        <f:facet name="header">

                            <h:outputText value="Usuário" />

                        </f:facet>             
                        <h:outputText value="#{lance.pessoa.nome}" />


                    </rich:column>

                    <rich:column>  
                        <f:facet name="header">

                            <h:outputText value="Leilão" />

                        </f:facet>      

                        <h:outputText value="#{lance.leilao.descricao}" />

                    </rich:column>

                    <rich:column>  
                        <f:facet name="header">

                            <h:outputText value="Data do Lance" />

                        </f:facet>             
                        <h:outputText value="#{lance.dataLance}">

                            <f:convertDateTime pattern="dd/MM/yyyy"/> 

                        </h:outputText>


                    </rich:column>

                    <rich:column>  
                        <f:facet name="header">

                            <h:outputText value="Hora do Lance" />

                        </f:facet>             
                        <h:outputText value="#{lance.horaLance}" >
                            <f:convertDateTime pattern="HH:mm:ss" />
                        </h:outputText>


                    </rich:column>

                    <rich:column>  
                        <f:facet name="header">

                            <h:outputText value="Valor" />

                        </f:facet>             
                        <h:outputText value="#{lance.valor}" />


                    </rich:column>

                    <rich:column>

                        <f:facet name="header">

                            <h:outputText value="Editar"/>

                        </f:facet>

                        <h:commandButton value="Editar" action="#{lanceController.editarLance()}" style="font-size: 13px;"/>

                    </rich:column>

                    <rich:column>

                        <f:facet name="header">

                            <h:outputText value="Excluir"/>

                        </f:facet>

                        <h:commandButton value="Excluir" action="#{lanceController.removerLance()}" style="font-size: 13px;"/>

                    </rich:column>



                </rich:dataTable>

                <br />

                <h:commandButton value="Novo" action="/restrito/lance/cadastrarLanceRestrito" style="font-size: 13px;"/>

            </p>




            <br/>
            <h:messages style="font-size: 13px; color: white;"/>

        </h:form>


    </ui:define>
</ui:composition>
